import request from "../utils/topic/topicRequest";
// 轮播图数组的类型
export interface NavData {
  columnUrl:string
  id:string
  mainTitle:string
  onlineType:boolean
  picUrl:string
  rank:number
  vaildEndTime:number
  vaildStartTime:number
  viceTitle: string
}
// 轮播图的类型
interface ResultList { 
  checkNavType:boolean
  delNavId:null
  navList: NavData[]
}

// 分页列表数组的类型

export interface Topic {
  avatar:string
  nickname:string
  picUrl:string
  subTitle:string
  title:string
  readCount:string
  topics:string
}

interface ResultList {
  0:{
    topics:Topic[]
  }
}
// 分页列表的类型
type PageList = {
  extra:null
  hasMore:boolean
  result:ResultList
}

export default {
    /**
     * @description 获取轮播图列表
     */
  getData() {
    return request.get<any,ResultList>(`/v1/know/navWap.json`);
  },

  /**
   * @description 获取分页列表
   * @param page 当前页
   * @param size 
   * @returns 
   */
  getPageList(page:number,size:number){
    return request.get<any,PageList>(`v1/find/recAuto.json?page=${page}&size=${size}`)
  }
};


